Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
glsl-token-inject-block
Advanced tools
Injects a "block" of GLSL tokens into a shader, after any #version
, #extension
and precision
statements. This will pad the new tokens with the necessary amount of newlines (but no more).
This module ignores token line
, column
and position
.
Your source:
var tokenizer = require('glsl-tokenizer')
var inject = require('glsl-token-inject-block')
var stringify = require('glsl-token-string')
var tokens = tokenizer(shaderInput)
var newToken = {
type: 'preprocessor',
data: '#define FOOBAR'
}
var source = stringify(inject(tokens, newToken))
console.log(source)
The following shader input:
// some comment
#version 300 es
#extension SOME_EXTENSION : enable
void main() {}
Results in the following injected define:
// some comment
#version 300 es
#extension SOME_EXTENSION : enable
#define FOOBAR
void main() {}
tokens = inject(tokens, newTokens)
For the given shader source (tokens
), injects newTokens
into them, assuming the new tokens are a "block" of code that should be placed on its own line.
newTokens
can be a single token object, or an array of token objects.
Modifies tokens
in place and returns it.
MIT, see LICENSE.md for details.
FAQs
safely inject a block of tokens into a shader
The npm package glsl-token-inject-block receives a total of 135,640 weekly downloads. As such, glsl-token-inject-block popularity was classified as popular.
We found that glsl-token-inject-block demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.